﻿* Encoding: UTF-8.

*********************************
Study 1
*********************************


*for Table S1
GLM jealous.loss sad.loss angry.loss happy.loss disgust.loss pride.loss 
jealous.loss3p sad.loss3p angry.loss3p happy.loss3p disgust.loss3p pride.loss3p
  /WSFACTOR=lossalone_loss3p 2 Polynomial reaction 6 Polynomial 
  /METHOD=SSTYPE(3)
  /PLOT=PROFILE(reaction*lossalone_loss3p)
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(lossalone_loss3p) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(reaction) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(lossalone_loss3p*reaction) compare (reaction)
  /EMMEANS=TABLES(lossalone_loss3p*reaction) compare (lossalone_loss3p)
  /PRINT=DESCRIPTIVE ETASQ 
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=lossalone_loss3p reaction lossalone_loss3p*reaction.


*********************************
Study 2
*********************************

use all.
FREQUENCIES sex.
DESCRIPTIVES vars age. 

*Included participants passing two early data checks*

USE ALL.
COMPUTE filter_$=(pass=1 & attn2=4 ).
VARIABLE LABELS filter_$ 'pass=1 & attn2=4  (FILTER)'.
VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.
FORMATS filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE.
FREQUENCIES sex.
DESCRIPTIVES vars age. 


*all reactions for the Table in the SOM
*GLM jealous  sadness anger proud afraid pity BY thirdparty_lossalone
  /WSFACTOR=emotions 6 Polynomial 
  /METHOD=SSTYPE(3)
  /PLOT=PROFILE(emotions*thirdparty_lossalone thirdparty_lossalone*emotions)
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(emotions) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(thirdparty_lossalone) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(thirdparty_lossalone*emotions) compare (emotions)
  /EMMEANS=TABLES(thirdparty_lossalone*emotions) compare (thirdparty_lossalone)
  /PRINT=DESCRIPTIVE ETASQ 
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=emotions 
  /DESIGN=thirdparty_lossalone.


*All tactics, separately, for the Table in the SOM 
*GLM vigilance_overall bepositive_overall beopen_overall assurances_overall 
socialnetworks_overall avoidance_overall humor_overall BY lossalone_control_thirdparty
  /WSFACTOR=guardingtactics 7  Polynomial 
  /METHOD=SSTYPE(3)
  /PLOT=PROFILE(guardingtactics*lossalone_control_thirdparty lossalone_control_thirdparty*guardingtactics)
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(lossalone_control_thirdparty) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(guardingtactics) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(lossalone_control_thirdparty*guardingtactics) compare (lossalone_control_thirdparty)
  /EMMEANS=TABLES(lossalone_control_thirdparty*guardingtactics) compare (guardingtactics)
  /PRINT=DESCRIPTIVE ETASQ 
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=guardingtactics 
  /DESIGN=lossalone_control_thirdparty.



*SUPPLEMENT: Medation for everyday friend retention
X (thirdparty_lossalone)
M jealousy sadness anger
Y everydayfr


*********************************
Study 3a
*********************************

*SUPPLEMENTAL ANALYSIS: does friendship jealousy over best friend + friends (stranger, own friend, partner) predict friend guarding vs. those same rivals
*(controlling for for sadness )?

compute aggregatedanger_versusALL=mean(bfstranger_5,  bfcf_5, bfnewmate_5).
compute aggregatedsadness_versusALL=mean(bfstranger_7,  bfcf_7, bfnewmate_7).
EXECUTE.
PARTIAL CORR
  /VARIABLES=aggregatedjealousy_versusALL aggregatedguarding_versusALL BY aggregatedanger_versusALL aggregatedsadness_versusALL
  /SIGNIFICANCE=oneTAIL
  /MISSING=LISTWISE.

*SUPPLEMENTAL ANALYSIS: Regression models showing friendship jealousy predicts friendguarding over and above sadness, anger

REGRESSION
  /MISSING LISTWISE
  /STATISTICS COEFF OUTS CI(95) R ANOVA CHANGE
  /CRITERIA=PIN(.05) POUT(.10)
  /NOORIGIN 
  /DEPENDENT overallbf_friendguard
  /METHOD=ENTER bfstranger_5 bfstranger_7
  /METHOD=ENTER bfstranger_3.
REGRESSION
  /MISSING LISTWISE
  /STATISTICS COEFF OUTS CI(95) R ANOVA CHANGE
  /CRITERIA=PIN(.05) POUT(.10)
  /NOORIGIN 
  /DEPENDENT overallbfcf_friendguard
  /METHOD=ENTER bfcf_5 bfcf_7
  /METHOD=ENTER bfcf_3.
REGRESSION
  /MISSING LISTWISE
  /STATISTICS COEFF OUTS CI(95) R ANOVA CHANGE
  /CRITERIA=PIN(.05) POUT(.10)
  /NOORIGIN 
  /DEPENDENT overallbfrom_friendguard
  /METHOD=ENTER bfnewmate_5 bfnewmate_7
  /METHOD=ENTER bfnewmate_3.

*SUPPLEMENTAL ANALYSIS - Mediation Tests 1 and 2

compute bfs3=1*bfstranger_3.
compute fgvss=1*overallbf_friendguard.
compute bfs5=1*bfstranger_5.
compute bfs7=1*bfstranger_7.
EXECUTE.

M variables: bfstranger_3 (shortname=bfs3) bfnewmate_3 (shortname=bfnm3)
Y variables: overallbf_friendguard (shortname = fgvs) overallbfrom_friendguard (shortname = fgvsrom)

M variables: aggregatedjealousy_versusfriends (shortname = ajvf) bfnewmate_3 (shortname=bfnm3)
bfstranger_7 (shortname = bfs7) bfnewmate_7 (shortname = bfnm7) 
bfstranger_5 (shortname = bfs5) bfnewmate_5 (shortname = bfnm5) 
Y variables: aggregatedguarding_versusfriends (shortname = agvf) overallbfrom_friendguard (shortname = fgvsrom)

*********************************
Study 3b
*********************************

*SUPPLEMENT: All affective reactions for Table 
GLM bfss_1 bfss_2 bfss_3 bfss_4 bfss_5 bfss_6 bfos_1 bfos_2 bfos_3 bfos_4 bfos_5 bfos_6 bfcf2_1 
    bfcf2_2 bfcf2_3 bfcf2_4 bfcf2_5 bfcf2_6 bfstmate_1 bfstmate_2 bfstmate_3 bfstmate_4 bfstmate_5 
    bfstmate_6 bfltm_1 bfltm_2 bfltm_3 bfltm_4 bfltm_5 bfltm_6 cfss_1 cfss_2 cfss_3 cfss_4 cfss_5 
    cfss_6 cfmate_1 cfmate_2 cfmate_3 cfmate_4 cfmate_5 cfmate_6 acq_1.0 acq_2.0 acq_3.0 acq_4.0 
    acq_5.0 acq_6.0
  /WSFACTOR=relationships 8 Polynomial react 6 Polynomial 
  /METHOD=SSTYPE(3)
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(relationships) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(react) COMPARE ADJ(LSD)
  /PRINT=DESCRIPTIVE ETASQ 
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=relationships react relationships*react.




*********************************
Study 4
*********************************

*Include participants passing two data checks*

USE ALL.
COMPUTE filter_$=(check1=1 & check2=2).
VARIABLE LABELS filter_$ 'check1=1 & check2=2 (FILTER)'.
VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.
FORMATS filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE.
FREQUENCIES sex.
DESCRIPTIVES vars age.


*condition: 
0 = best friend + same-sex stranger
1 = best friend + own close friend
2 = best friend + new romantic partner
3 = own mate + interloper


*SUPPLEMENT: all affective reactions
GLM jealousy  sad anger pity afraid pride BY condition
  /WSFACTOR=emotion 6 Polynomial 
  /METHOD=SSTYPE(3)
  /PLOT=PROFILE(emotion*condition condition*emotion)
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(condition) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(emotion) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(condition*emotion) compare (emotion)
  /EMMEANS=TABLES(condition*emotion) compare (condition)
  /PRINT=DESCRIPTIVE ETASQ 
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=emotion 
  /DESIGN=condition.




*********************************
Study 5a
*********************************


USE ALL.
COMPUTE filter_$=(bots=1 & sex<=3).
VARIABLE LABELS filter_$ 'bots=1 & sex<=3 (FILTER)'.
VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.
FORMATS filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE.

*SUPPLEMENT - all reactions
GLM  bfbfj_1 bfbfj_4 bfbfj_5  bfbfj_2 bfbfj_3 
bfromj_1 bfromj_4 bfromj_5 bfromj_2 bfromj_3 
   bfacqj_1  bfacqj_4 bfacqj_5  bfacqj_2 bfacqj_3
  /WSFACTOR=targets 3 Polynomial reactivity 5 Polynomial 
  /METHOD=SSTYPE(3)
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(targets) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(reactivity) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(targets*reactivity) 
  /PRINT=DESCRIPTIVE ETASQ 
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=targets reactivity targets*reactivity.



*********************************
Study 5b
*********************************

*Included participants*

USE ALL.
COMPUTE filter_$=(bots=1).
VARIABLE LABELS filter_$ 'bots=1 (FILTER)'.
VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.
FORMATS filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE.


*SUPPLEMENT - all reactions across interlopers (same-sex person, romantic partner, acqaintance)
GLM  bfbfj_1 bfbfj_4 bfbfj_5  bfbfj_2 bfbfj_3 
bfromj_1 bfromj_4 bfromj_5 bfromj_2 bfromj_3 
   bfacqj_1  bfacqj_4 bfacqj_5  bfacqj_2 bfacqj_3
  /WSFACTOR=targets 3 Polynomial reactivity 5 Polynomial 
  /METHOD=SSTYPE(3)
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(targets) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(reactivity) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(targets*reactivity) 
  /PRINT=DESCRIPTIVE ETASQ 
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=targets reactivity targets*reactivity.


*SUPPLEMENT : Mediation via MEMORE - testing which emotions drive friend guarding
M variables: jealousy (bfbfj_1 bfromj_1) sadness (bfbfj_4 bfromj_4) anger (bfbfj_5 bfromj_5)
Y variables: friend guarding (fgvsf fgvsrom)



*********************************
*Study 6
*********************************

*participants - include those passing checks

USE ALL.
COMPUTE filter_$=(botcheck = 1 & Q40 =4).
VARIABLE LABELS filter_$ 'botcheck = 1 & Q40 =4 (FILTER)'.
VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.
FORMATS filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE.
FREQUENCIES q5.
DESCRIPTIVES vars q7.

*because of low reliability, we also created a second composite for
everyday friend retention

*compute everydayretetnion2=mean(fg_3, fg_4, fg_5,  fg_7).
*RELIABILITY
  /VARIABLES=fg_3, fg_4, fg_5,  fg_7
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.

*GLM friendguard everydayretetnion2 BY control.jealous
  /WSFACTOR=intent 2 Polynomial 
  /METHOD=SSTYPE(3)
  /PLOT=PROFILE(intent*control.jealous)
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(control.jealous) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(intent) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(control.jealous*intent) compare (intent)
  /EMMEANS=TABLES(control.jealous*intent) compare (control.jealous)
  /PRINT=DESCRIPTIVE ETASQ 
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=intent 
  /DESIGN=control.jealous.

*SUPPLEMENT - focal ANOVA disaggregating tactics
*GLM vigilance monopolizarion inducej possess everydayretetnion BY control.jealous
  /WSFACTOR=tactics 5 Polynomial 
  /METHOD=SSTYPE(3)
  /PLOT=PROFILE(tactics*control.jealous)
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(control.jealous) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(tactics) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(control.jealous*tactics) compare (tactics)
  /EMMEANS=TABLES(control.jealous*tactics) compare (control.jealous)
  /PRINT=DESCRIPTIVE ETASQ 
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=tactics 
  /DESIGN=control.jealous.



*********************************
*Study 7
*********************************

USE ALL.
COMPUTE filter_$=(jealous>=1).
VARIABLE LABELS filter_$ 'jealous>=1 (FILTER)'.
VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.
FORMATS filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE.

*SUPPLEMENT for table with all reactions
GLM jealous sad angry  disgusted proud happy guilty relieved enthusiastic nothing BY alliance time
  /WSFACTOR=reactivity 10 Polynomial 
  /METHOD=SSTYPE(3)
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(alliance) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(time) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(reactivity) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(alliance*time) 
  /EMMEANS=TABLES(alliance*reactivity) 
  /EMMEANS=TABLES(time*reactivity) 
  /EMMEANS=TABLES(alliance*time*reactivity) 
  /PRINT=DESCRIPTIVE ETASQ 
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=reactivity 
  /DESIGN=alliance time alliance*time.



*********************************
Study 8a
*********************************


*include those passing first check*

USE ALL.
COMPUTE filter_$=(attn1=1).
VARIABLE LABELS filter_$ 'attneth=1 (FILTER)'.
VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.
FORMATS filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE.
FREQUENCIES sex. 
DESCRIPTIVES vars age.


*SUPPLEMENT - all reactions (jealous, happy, proud, pity)
*GLM Q86_4 Q86_7 Q86_8 Q86_10  BY rom.friend
  /WSFACTOR=factor1 4 Polynomial 
  /METHOD=SSTYPE(3)
  /PLOT=PROFILE(factor1*rom.friend)
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(rom.friend) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(factor1) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(rom.friend*factor1) compare (rom.friend)
  /PRINT=DESCRIPTIVE ETASQ 
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=factor1 
  /DESIGN=rom.friend.


**additional analysis of those passing both checks

USE ALL.
COMPUTE filter_$=(attneth=1 & attn1=1).
VARIABLE LABELS filter_$ 'attneth=1 & attn1=1(FILTER)'.
VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.
FORMATS filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE.
FREQUENCIES sex.

UNIANOVA Q86_4 BY rom.friend 
  /METHOD=SSTYPE(3)
  /INTERCEPT=INCLUDE
  /PLOT=PROFILE(rom.friend)
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(rom.friend) COMPARE ADJ(LSD)
  /PRINT=ETASQ DESCRIPTIVE
  /CRITERIA=ALPHA(.05)
  /DESIGN= rom.friend.


UNIANOVA distance BY rom.friend
  /METHOD=SSTYPE(3)
  /INTERCEPT=INCLUDE
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(rom.friend) COMPARE ADJ(LSD)
  /PRINT=ETASQ DESCRIPTIVE
  /CRITERIA=ALPHA(.05)
  /DESIGN=rom.friend.

*MEDIATION: PROCESS Model 4
X: rom.friend
M: jealousy (Q86_4)
Y: chosen seating distance (distance)



*********************************
Study 8b
*********************************

*include those passing first check*

USE ALL.
COMPUTE filter_$=(attn1=1).
VARIABLE LABELS filter_$ 'attneth=1 (FILTER)'.
VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.
FORMATS filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE.
FREQUENCIES sex. 
DESCRIPTIVES vars age.


*SUPPLEMENT for all reactions (jealousy, guilty, pity, afraid, comfortable)
GLM Q86_4 Q86_7 Q86_10 Q86_11 Q86_13 BY RTlo.hi
  /WSFACTOR=factor1 5 Polynomial 
  /METHOD=SSTYPE(3)
  /PLOT=PROFILE(factor1*RTlo.hi)
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(RTlo.hi) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(factor1) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(RTlo.hi*factor1) compare (RTlo.hi)
  /PRINT=DESCRIPTIVE ETASQ 
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=factor1 
  /DESIGN=RTlo.hi.


**additional analysis of those passing both checks



USE ALL.
COMPUTE filter_$=(attneth=1 & attn1=1).
VARIABLE LABELS filter_$ 'attneth=1 & attn1=1(FILTER)'.
VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.
FORMATS filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE.
FREQUENCIES sex.

UNIANOVA Q86_4 BY RTlo.hi
  /METHOD=SSTYPE(3)
  /INTERCEPT=INCLUDE
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(RTlo.hi) COMPARE ADJ(LSD)
  /PRINT=ETASQ DESCRIPTIVE
  /CRITERIA=ALPHA(.05)
  /DESIGN=RTlo.hi.


UNIANOVA distance BY RTlo.hi
  /METHOD=SSTYPE(3)
  /INTERCEPT=INCLUDE
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(RTlo.hi) COMPARE ADJ(LSD)
  /PRINT=ETASQ DESCRIPTIVE
  /CRITERIA=ALPHA(.05)
  /DESIGN=RTlo.hi.

*MEDIATION: PROCESS Model 4
X: RTlo.hi
M: jealousy (Q86_4)
Y: chosen seating distance (distance)
